<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('债权线索列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>债权人：</label>
                            <input type="text" name="creditorName"/>
                        </li>
                        <li>
                            <label>债务人：</label>
                            <input type="text" name="debtorName"/>
                        </li>
                        <li>
                            <label>编码：</label>
                            <input type="text" name="bondCode"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="business:clue:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.editFull()" shiro:hasPermission="business:clue:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:clue:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:clue:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var listFlag = [[${@permission.hasPermi('business:clue:list')}]];
    var editFlag = [[${@permission.hasPermi('business:clue:edit')}]];
    var removeFlag = [[${@permission.hasPermi('business:clue:remove')}]];
    var documentStatusDatas = [[${@dict.getType('business_whether')}]];
    var approvalStatusDatas = [[${@dict.getType('approval_status')}]];
    var payStatusDatas = [[${@dict.getType('pay_status')}]];
    var prefix = ctx + "business/clue";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "债权线索",
            columns: [{
                checkbox: true
            },
                {
                    field: 'clueId',
                    title: '线索id',
                    visible: false
                },
                {
                    field: 'creditorName',
                    title: '主债权人名称'
                },
                {
                    field: 'contactNumber',
                    title: '主债权人联系电话'
                },

                {
                    field: 'civilJudgmentFont',
                    title: '民事判决书（或者仲裁书、调解书）字号'
                },
                {
                    field: 'court',
                    title: '执行法院'
                },
                {
                    field: 'judgmentMatter',
                    title: '判决书标的额（未执行部分）'
                },
                {
                    field: 'debtorName',
                    title: '债务人姓名'
                },
                {
                    field: 'rewardAmount',
                    title: '有偿征集债务人出资金额（或债权标的额比例）'
                },
                // {
                //     field: 'mandataryPhone',
                //     title: '被委托人联系电话'
                // },
                // {
                //     field: 'rewardGiver',
                //     title: '债权人'
                // },
                // {
                //     field: 'province',
                //     title: '省',
                //     visible: false
                // },
                // {
                //     field: 'city',
                //     title: '市',
                //     visible: false
                // },
                // {
                //     field: 'area',
                //     title: '区',
                //     visible: false
                // },
                // {
                //     field: 'address',
                //     title: '所在地址'
                // },
                // {
                //     field: 'contactNumber',
                //     title: '联系电话'
                // },
                // {
                //     field: 'contactPerson',
                //     title: '联系人'
                // },
                // {
                //     field: 'detailedDescription',
                //     title: '详细描述'
                // },
                {
                    field: 'bondCode',
                    title: '信息对应的管理编码'
                },

                // {
                //     field: 'approvalStatus',
                //     title: '审批状态',
                //     formatter: function(value, row, index) {
                //         return $.table.selectDictLabel(approvalStatusDatas, value);
                //     }
                // },
                // {
                //     field: 'rejectionReasons',
                //     title: '驳回原因',
                //     visible: false
                // },
                // {
                //     field: 'approvalTime',
                //     title: '审批时间'
                // },
                //
                // {
                //     field: 'approver',
                //     title: '审批人',
                //     visible: false
                // },
                // {
                //     field: 'payStatus',
                //     title: '支付状态',
                //     formatter: function(value, row, index) {
                //         return $.table.selectDictLabel(payStatusDatas, value);
                //     }
                // },
                {
                    field: 'createTime',
                    title: '发布时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + listFlag + '" href="javascript:void(0)" onclick="audit(\'' + row.clueId + '\')"><i class="fa fa-edit"></i>审核</a> ');
                        // actions.push('<a class="btn btn-success btn-xs ' + listFlag + '" href="javascript:void(0)" onclick="pay(\'' + row.clueId + '\')"><i class="fa fa-edit"></i>支付确认</a> ');

                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.clueId + '\')"><i class="fa fa-edit"></i>修改</a> ');
                        actions.push('<a class="btn btn-success btn-xs ' + listFlag + '" href="javascript:void(0)" onclick="info(\'' + row.clueId + '\')"><i class="fa fa-edit"></i>详情</a> ');

                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.clueId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    function audit(clueId) {
        var url = prefix + '/audit/' + clueId;
        $.modal.openFull("审批", url);
    }
    function pay(clueId) {
        var url = prefix + '/pay/' + clueId;
        $.modal.openFull("支付确认", url);
    }
    function info(clueId) {
        var url = prefix + '/info/' + clueId;
        $.modal.openTab("详情", url);
    }
</script>
</body>
</html>